Push Notifications - REST
When an event is triggered in Push Notifications, OIPA will look into the database for Downstream application details and security details. PushNotifications will retrieve downstream and security details from AsOutboudApplications and AsOutboundSecurtiy tables.
DMP with REST supports asynchronous REST calls. Downstream details required to communicate using REST protocol:
"applicationUri": "APPLICATION URL"
"contentType":"application/JSON" or "application/XML"
Required security details for authentication: token
For REST token should be in below format
"Base64 encoded(UserName:password)"
or
Base64 encoded(ClientId:ClientSecret)
A downstream administrator can update the application and security details using REST API's. For more information on REST API's for Downstream message push, refer to REST API documentation. Push Notifications will construct messages in XML. If the content type is selected as application/JSON then, the message will be converted to JSON while pushing it downstream. If content type is selected as application/XML OIPA will send a message in XML format to the downstream.
XML Schema
<PushNotifications>
<Templates>
<Template ID="[name]">
<Parameters>
<Parameter NAME="[name]">[field | variable]</Parameter>
<Parameter>...</Parameter>
</Parameters>
<JSTLMessage><[parameter name]>[parameter attribute name | literal]</[parameter name]><[parameter name]>...</[parameter name]>
</JSTLMessage>
</Template>
<Template>
...
</Template>
</Templates>
<PushNotification EVENTNAME="[name]">
<Message ID="">
<Tests>
<Test>[condition]</Test>
<Test>...</Test>
</Tests>
<AsEventMessage
xmlns="[name space]">
<JSTLTemplate>[id]</JSTLTemplate>
<JSTLTemplate>...</JSTLTemplate>
<JSTLMessage>
<Parameters>
<Parameter NAME="[name]" DATATYPE="[TEXT | INTEGER | DECIMAL | DATE | BOOLEAN | CURRENCY | BIGTEXT]" >[]</Parameter>
<Parameter>...</Parameter>
</Parameters><[parameter name]>[parameter attribute name | literal]</[parameter name]><[parameter name]>...</[parameter name]>
</JSTLMessage>
</AsEventMessage>
</Message>
<OnTransactionFailure>[failure message id]</OnTransactionFailure>
</PushNotification>
<OnTransactionFailure>
<Message ID="[failure message id]">
<AsEventMessage
xmlns="[name space]">
<JSTLTemplate>[id]</JSTLTemplate>
<JSTLTemplate>...</JSTLTemplate>
<JSTLMessage>
<Parameters>
<Parameter NAME="[name]" DATATYPE="[TEXT | INTEGER | DECIMAL | DATE | BOOLEAN | CURRENCY | BIGTEXT]" >[]</Parameter>
<Parameter>...</Parameter>
</Parameters><[parameter name]>[parameter attribute name | literal]</[parameter name]><[parameter name]>...</[parameter name]>
</JSTLMessage>
</AsEventMessage>
</Message>
<Message>
...
</Message>
</OnTransactionFailure>
<OnPushFailure>
<RollbackTransaction>[Yes | No]</RollbackTransaction>
<CreateBusinessError>[Yes | No]</CreateBusinessError>
</OnPushFailure>
</PushNotifications>
XML Example
<PushNotifications>
<PushNotification EVENTNAME="Billing">
<Message ID='BillingMsg1'>
<AsActivityMessage>
<JSTLMessage>
<Parameters>
<Parameter NAME="EffectiveDate" DATATYPE="Date">EffectiveDateMv</Parameter>
<Parameter NAME="PolicyNumber" DATATYPE="Text">PolicynumberMv</Parameter>
<Parameter NAME="PaidToDate" DATATYPE="Date">PaidToDateMv</Parameter>
<Parameter NAME="ModalPremium" DATATYPE="Integer">ModalPremiumMv</Parameter>
<Parameter NAME="EFTModalPremium" DATATYPE="Integer">EFTModalPremiumMv</Parameter>
<Parameter NAME="AnnualDiscount" DATATYPE="Integer">AnnualDiscountMv</Parameter>
</Parameters>
<Event EVENTNAME="Billing"></Event>
<MsgGUID>[MESSAGEGUID]</MsgGUID>
<EffectiveDate>[EffectiveDate]</EffectiveDate>
<PolicyNumber>[PolicyNumber]</PolicyNumber>
<PaidToDate>[PaidToDate]</PaidToDate>
<Premium>
<ModalPremium>[ModalPremium]</ModalPremium>
<EFTModalPremium>[EFTModalPremium]</EFTModalPremium>
<AnnualDiscount>[AnnualDiscount]</AnnualDiscount>
<EffectiveDate>[EffectiveDate]</EffectiveDate>
</Premium>
</JSTLMessage>
</AsActivityMessage>
</Message>
</PushNotification>
<OnTransactionFailure></OnTransactionFailure>
<OnPushFailure>
<RollbackTransaction>Yes</RollbackTransaction>
<CreateBusinessError>Yes</CreateBusinessError>
</OnPushFailure>
</PushNotifications>
Output
<AsActivityMessage>
<Event EVENTNAME="Billing"></Event>
<MsgGUID>9B5AA155-4F7B-46AC-9A92-A253BE14C6B7</MsgGUID>
<EffectiveDate>2016-11-01</EffectiveDate>
<PolicyNumber>A000075449</PolicyNumber>
<PaidToDate>2017-11-01</PaidToDate>
<Premium>
<ModalPremium>380</ModalPremium>
<EFTModalPremium>400</EFTModalPremium>
<AnnualDiscount>20</AnnualDiscount>
<EffectiveDate>2016-11-01</EffectiveDate>
</Premium>
</AsActivityMessage>
JSON Output
{
"AsActivityMessage": {
"Event": {
"attributes": {
"eventname": "Billing"
}
},
"MsgGUID": "9B5AA155-4F7B-46AC-9A9-A253BE14C6B7",
"EffectiveDate": "2016-11-01",
"PolicyNumber": "A000075449",
"PaidToDate": "2017-11-01",
"Premium": {
"ModalPremium": "380",
"EFTModalPremium": "400",
"AnnualDiscount": "20",
"EffectiveDate": "2016-11-01"
}
}
}
Note: Message keys and Values will follow their original case and will not get converted while converting the message to JSON.
Example of Mixed Content
If a message has both text and tags and looks like a template the JSON output will be constructed as a template. Values for the message will be replaced where ever XML tags are given and look like below:
<PushNotifications>
<PushNotification EVENTNAME="Billing">
<Message ID='BillingMsg1'>
<EventBilling>
<JSTLMessage>
<Parameters>
<Parameter NAME="ClientName" DATATYPE="Text">ClientName</Parameter>
<Parameter NAME="DocRequest" DATATYPE="Integer">DocumentRequest</Parameter>
<Parameter NAME="ShipDate" DATATYPE="Date">ShipDate</Parameter>
</Parameters>
<PolicyDocument>
Dear Mr. <ClientName>John Smith</ClientName>.
Your order <DocRequest>1032</DocRequest>
will be shipped on <shipdate>2001-07-13</shipdate>.
</PolicyDocument>
</JSTLMessage>
</EventBilling>
</Message>
</PushNotification>
</PushNotifications>
XML Output
<EventBilling>
<PolicyDocument> Dear Mr. <ClientName>John Smith</ClientName>Your document request no<DocRequest>1032</DocRequest> will be shipped on <shipdate>2020-07-22</shipdate>.
</PolicyDocument>
</EventBilling>
JSON Output
{
"eventbilling": {
"policydocument": {
"#value": "\n Dear Mr. ",
"clientname": "John Smith",
"#value1": ".\n Your document request no",
"docrequest": "1032",
"#value2": "\n will be shipped on",
"shipdate": "2020-07-22"
}
}
}
Example3: Example of body of the fileReceived request in XML and its JSON conversion
<fil:processFileReceived xmlns:fil="http://FileReceived">
<fileId>NTT</fileId>
<xml><![CDATA[
<NewClient>
<FirstName>Michal</FirstName>
<LastName>Mathew</LastName>
<SSN>12345679</SSN>
</NewClient>]]>
</fil:processFileReceived>
Output JSON
{
"fil:processfilereceived": {
"attributes": {
"xmlns:fil": "http://FileReceived"
},
"fileid": "NTT",
"xml": {
"#cdata": "<NewClient>\n\t\t<FirstName>Michal</FirstName>\n\t\t\t <LastName>Mathew</LastName>\n\t\t\t<SSN>12345679</SSN>\n\t\t</NewClient>"
}
}
}
Example of Attribute Conversion
<Message>
<Event EVENTNAME="Billing">
<MsgGUID>9B5AA155-4F7B-46AC-9A92-A253BE14C6B7</MsgGUID>
<EffectiveDate>2016-11-01</EffectiveDate>
<PolicyNumber STATUS='Pending'>A000075449</PolicyNumber>
<PaidToDate>2017-11-01</PaidToDate>
<Premium>
<ModalPremium>380</ModalPremium>
<EFTModalPremium>400</EFTModalPremium>
<AnnualDiscount>20</AnnualDiscount>
</Premium>
</Event>
</Message>
Output JSON
{
"message":{
"event":{
"attributes":{
"eventname":"Billing"
},
"msgguid":"9B5AA155-4F7B-46AC-9A92-A253BE14C6B7",
"effectivedate":"2016-11-01",
"policynumber":{
"attributes":{
"status":"Pending"
},
"#value":"A000075449"
},
"paidtodate":"2017-11-01",
"premium":{
"modalpremium":"380",
"eftmodalpremium":"400",
"annualdiscount":"20"
}
}
}
}